import { EntityManager, MikroORM } from '@mikro-orm/mysql';
import { InjectEntityManager, InjectMikroORM } from '@mikro-orm/nestjs';
import { Controller } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('(用户) 兼职-关注')
@Controller('concern')
export class ConcernController {
    constructor(
        @InjectMikroORM('zp')
        private readonly orm : MikroORM,
        @InjectEntityManager('zp')
        private readonly em : EntityManager
    ){}
}

        // const publisher_ids = this.em.qb(JobUserConcerns).select(['publisher']).where({userId:userId})
        // // JobUserConcern::select(['publisher_id'])->where(['user_id'=>$user_id])->get();
        // const tasks = await this.em.qb(JobTasks)
        // .select(['startDate',this.em.raw('count(*) as count')])
        // .where({creatorId: {$in:publisher_ids.getKnexQuery()}})
        // .andWhere({startDate:{$lte:nowdate}})
        // .groupBy('startDate')
        // .orderBy({startDate:'ASC'})
        // .execute();

        // JobTask::select('start_date',DB::raw('count(*) as count'))
        // ->whereIN('creator_id',$publisher_ids)
        // ->where('start_date','>=', $nowdate)
        // ->groupBy('start_date')
        // ->orderBy('start_date','asc');